﻿using System;
using System.Collections;

namespace QuailDashboard.View.Data
{
    /// <summary>
    /// Generic interface for hierachal data
    /// </summary>
    public interface IHierarchalData
    {
        /// <summary>
        /// Fires when the Populate async method has completed
        /// </summary>
        event EventHandler PopulateComplete;

        /// <summary>
        /// Gets the key for the hierarchal data
        /// </summary>
        long Key { get; }

        /// <summary>
        /// Gets the parent for this heirarchal data item
        /// </summary>
        IHierarchalData Parent { get; }

        /// <summary>
        /// Gets a list of items
        /// </summary>
        IList Items { get; }

        /// <summary>
        /// Gets a value indicating whether the Items are populated
        /// </summary>
        bool IsPopulated { get; }

        /// <summary>
        /// Populates the list of items
        /// </summary>
        void Populate();
    }
}
